'''
绘图作品类
'''
from mongoengine import Document, BooleanField, DateTimeField, StringField, ListField, EmbeddedDocumentField

class Painting(Document):

    name = StringField(required=True)
    image_uri = StringField(required=True)
    # 图片大小
    size = StringField(required=True)
    # 图片类别
    category = StringField(required=True)
    # 图片标签
    tags = ListField(StringField())
    # 图片简述
    description = StringField(required=True)
    create_time = DateTimeField(default=None)

    meta = {
        'collection': 'painting',
        'db_alias': 'painter'
    }